#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include <QSettings>
#include <QDebug>
#include <configmanager.h>

AboutDialog::AboutDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint);
    setStyleSheet("QDialog { border: 1px solid gray; }");
    ui->frame->setStyleSheet("border-bottom:1px solid gray;");
    ui->comIconLabel->setPixmap(QPixmap(":/image/logo.jpg").scaled(ui->comIconLabel->width(),ui->comIconLabel->height(),Qt::KeepAspectRatioByExpanding));
    ui->iconLabel->setPixmap(QPixmap(":/image/comIcon21X21.png").scaled(ui->iconLabel->width(),ui->iconLabel->height(),Qt::KeepAspectRatio));


    ui->author_label->setText("作者:" + ConfigManager::getInstance().getAuthorInfo());
    ui->version_label->setText("版本:" + ConfigManager::getInstance().getVersionInfo());
    ui->time_label->setText("时间:" + ConfigManager::getInstance().getModifyTime());
}

AboutDialog::~AboutDialog()
{
    delete ui;
}

void AboutDialog::on_toolButton_clicked()
{
    this->close();
}

void AboutDialog::on_pushButton_clicked()
{
    this->close();
}
